#include <stdio.h>
#include <libavutil/log.h>
#include <libavformat/avformat.h>



int main(){
    AVIODirContext *context=NULL;
    AVIODirEntry *entry=NULL;
    av_log_set_level(AV_LOG_DEBUG);
    av_log(NULL,AV_LOG_DEBUG,"Hello world\n");
    int ret1=avpriv_io_move("/Users/renmeishan/Desktop/c/33player/asset/aaa.mp4","/Users/renmeishan/Desktop/c/33player/asset/111.mp4");
    int ret=avpriv_io_delete("/Users/renmeishan/Desktop/c/33player/src/shan.text");
    if (ret<0)
    {
        av_log(NULL,AV_LOG_ERROR,"No This File");
    }
    if (ret1>=0){
        av_log(NULL,AV_LOG_ERROR,"File rename success");
    }
    
    int ret2 =avio_open_dir(&context,"/Users/renmeishan/Desktop/c/33player/asset/",NULL);
    if (ret2<0)
    {
       av_log(NULL,AV_LOG_ERROR,"No This FileGroup");
       return -1;
    }
    while (1)
    {
      ret2= avio_read_dir(context,&entry);
      if (ret2<0)
      {
          av_log(NULL,AV_LOG_ERROR,"No Child file");
         goto _Fail;
      };
      if (!entry)
      {
         break;
      }
       av_log(NULL,AV_LOG_ERROR,"%s \n",entry->name);
       avio_free_directory_entry(&entry);
      
    }

     _Fail:
    avio_close_dir(&context);
  
    return 0;
}